<div class="modal-header">
	<h4 class="modal-title" id="PasswordModalLabel">修改密码</h4>
</div>
<div class="modal-body custom-scroll terms-body" id="passwordmodalbody">
	<div class="col-lg-12">
		<div class="well no-padding">
			<form id="form-edit" method="post" class="smart-form client-form"
				action="user/updatepassword/#(userid)">
				<fieldset>
					<div class="row">
						<section class="col col-xs-12 col-sm-12">
							<label class="label">新密码</label> <label class="input"> <i
								class="icon-append fa fa-lock"></i> <input type="password"
								id="newpassword" name="newpassword" placeholder="新密码"
								id="password"> <b class="tooltip tooltip-bottom-right">请输入新密码</b>
							</label>
						</section>

						<section class="col col-xs-12 col-sm-12">
							<label class="label">确认密码</label> <label class="input"> <i
								class="icon-append fa fa-lock"></i> <input type="password"
								name="passwordconfirm" placeholder="确认密码"> <b
								class="tooltip tooltip-bottom-right">请输入确认密码</b>
							</label>
						</section>
					</div>

				</fieldset>
				<footer>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					<button id="save" name="save" type="submit" class="btn btn-primary">确定</button>
				</footer>
			</form>
		</div>
	</div>
</div>

<script type="text/javascript">
	$(function() {
		var errorClass = 'invalid';
		var errorElement = 'em';
		// Validation
		$("#form-edit").validate(
				{
					errorClass : errorClass,
					errorElement : errorElement,
					highlight : function(element) {
						$(element).parent().removeClass('state-success')
								.addClass("state-error");
						$(element).removeClass('valid');
					},
					unhighlight : function(element) {
						$(element).parent().removeClass("state-error")
								.addClass('state-success');
						$(element).addClass('valid');
					},
					// Rules for form validation
					rules : {
						newpassword : {
							required : true,
							minlength : 5,
							maxlength : 15
						},
						passwordconfirm : {
							required : true,
							minlength : 5,
							maxlength : 15,
							equalTo : '#newpassword'
						}
					},

					// Messages for form validation
					messages : {
						newpassword : {
							required : '请输入新密码',
							minlength : '请输入至少5个字符',
							maxlength : '请输入最多15个字符'
						},
						passwordconfirm : {
							required : '请再次输入新密码',
							minlength : '请输入至少5个字符',
							maxlength : '请输入最多15个字符',
							equalTo : '两次输入的密码不相同'
						}
					},
					// Do not change code below
					errorPlacement : function(error, element) {
						error.insertAfter(element.parent());
					}
				});
	});
</script>